package cupk.abner;

public class FADepartment extends Department{
    @Override
    public void visitor(FullTimeEmployee employee) {
        int workTime = employee.getWorkTime();
        double weeklyWage = employee.getWeeklyWage();
        if (workTime > 40) {
            weeklyWage = weeklyWage + (workTime - 40) * 100;
        } else if (workTime < 40) {
            weeklyWage = weeklyWage - (40 - workTime) * 80;
            if (weeklyWage < 0) {
                weeklyWage = 0;
            }
        }
        System.out.println("正式员工 " + employee.getName() + ",工作时间：" + workTime +  "小时，周工资：" + weeklyWage + "元");
    }

    @Override
    public void visitor(PartTimeEmployee employee) {
        double workTime = employee.getWorkTime();
        double hourWage = employee.getHourWage();
        System.out.println("临时工 " + employee.getName() + ",时薪："+employee.getHourWage() + "元" + "，周工资：" + hourWage * workTime + "元");
    }
}